#!/usr/bin/env php
<?php
function br2nl($text) {   
	return preg_replace('/<br\\s*?\/??>/i', "\n", $text);  
}

$str = count($argv) <= 1 ? file_get_contents("php://stdin") : $argv[1];
$result  = br2nl($str);
$result = html_entity_decode($result);
$result = strip_tags($result);
echo $result;

?>
